<?php
function label($row, $item){
    switch($row[$item.' type']) {
        case 'literal':
            $label = '"'.$row[$item].'"';
            break;
        case 'uri':
            $label = '<'.$row[$item].'>';
            break;
        default:
            $label = $row[$item];
    }
    return $label;
}

function query($q, $store){
    $rs = $store->query($q);
    if(!$store->getErrors()){
        //print($q);
    }else{
        print("ERROR!!! :\n".$q."\n");
        print_r($store->getErrors());
        exit(1);
    }
}
?>
